package com.tomorrowbbs.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tomorrowbbs.mapper.UserIntegralRecordMapper;
import com.tomorrowbbs.domain.UserIntegralRecord;
import com.tomorrowbbs.service.IUserIntegralRecordService;

/**
 * 用户积分记录Service业务层处理
 * 
 * @author zjz
 * @date 2024-11-09
 */
@Service
public class UserIntegralRecordServiceImpl implements IUserIntegralRecordService 
{
    @Autowired
    private UserIntegralRecordMapper userIntegralRecordMapper;

    /**
     * 查询用户积分记录
     * 
     * @param recordId 用户积分记录主键
     * @return 用户积分记录
     */
    @Override
    public UserIntegralRecord selectUserIntegralRecordByRecordId(Long recordId)
    {
        return userIntegralRecordMapper.selectUserIntegralRecordByRecordId(recordId);
    }

    /**
     * 查询用户积分记录列表
     * 
     * @param userIntegralRecord 用户积分记录
     * @return 用户积分记录
     */
    @Override
    public List<UserIntegralRecord> selectUserIntegralRecordList(UserIntegralRecord userIntegralRecord)
    {
        return userIntegralRecordMapper.selectUserIntegralRecordList(userIntegralRecord);
    }

    /**
     * 新增用户积分记录
     * 
     * @param userIntegralRecord 用户积分记录
     * @return 结果
     */
    @Override
    public int insertUserIntegralRecord(UserIntegralRecord userIntegralRecord)
    {
//        userIntegralRecord.setCreateTime(DateUtils.getNowDate());
        return userIntegralRecordMapper.insertUserIntegralRecord(userIntegralRecord);
    }

    /**
     * 修改用户积分记录
     * 
     * @param userIntegralRecord 用户积分记录
     * @return 结果
     */
    @Override
    public int updateUserIntegralRecord(UserIntegralRecord userIntegralRecord)
    {
        return userIntegralRecordMapper.updateUserIntegralRecord(userIntegralRecord);
    }

    /**
     * 批量删除用户积分记录
     * 
     * @param recordIds 需要删除的用户积分记录主键
     * @return 结果
     */
    @Override
    public int deleteUserIntegralRecordByRecordIds(Long[] recordIds)
    {
        return userIntegralRecordMapper.deleteUserIntegralRecordByRecordIds(recordIds);
    }

    /**
     * 删除用户积分记录信息
     * 
     * @param recordId 用户积分记录主键
     * @return 结果
     */
    @Override
    public int deleteUserIntegralRecordByRecordId(Long recordId)
    {
        return userIntegralRecordMapper.deleteUserIntegralRecordByRecordId(recordId);
    }
}
